<?php
class View_Administration_Module extends CMF_Krypton_Core_DefinitionView
{
	public static $linkId	= 'manageModules';

	public function buildContent()
	{
		$moduleId	= $this->request->get( 'moduleId' );
		if( $moduleId )
		{
			switch( $this->request->get( 'action' ) )
			{
				case 'editModule':
					$view		= new View_Administration_Module_Edit();
					$content	= $view->buildContent( $moduleId );
					break;
				default:
					$view		= new View_Administration_Module_View();
					$content	= $view->buildContent( $moduleId );
			}
		}
		else
		{
			switch( $this->request->get( 'action' ) )
			{
				case 'addModule':
					$view		= new View_Administration_Module_Add();
					$content	= $view->buildContent();
					break;
				default:
					$view		= new View_Administration_Module_List();
					$content	= $view->buildContent();
			}
		}
		return $content;
	}

	protected function getUrl( $parameters = array() )
	{
		$param	= http_build_query( $parameters, NULL, '&' );
		$param	= $param ? '&'.$param : '';
		$url	= './?link='.self::$linkId.$param;
		return $url;
	}}
?>
